package cn.momo.mobile.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class CommShare {
	Context context;
	private SharedPreferences share;
	public CommShare(Context ctx){
		context = ctx;
		share = context.getSharedPreferences("commonset", Context.MODE_PRIVATE);
	}
	
	public int getStealMode(){
		return share.getInt("stealmode", 0);
	}
	
	public boolean setStealMode(int i){
		Editor editor = share.edit();
		editor.putInt("stealmode", i);
		return editor.commit();
	}
	
	public boolean getIfNotify(){
		return share.getBoolean("ifnotify", false);
	}
	
	public boolean setIfNotify(boolean flag){
		Editor editor = share.edit();
		editor.putBoolean("ifnotify", flag);
		return editor.commit();
	}
	
	public boolean getIfShowContent(){
		return share.getBoolean("ifshowcontent", false);
	}
	
	public boolean setIfShowContent(boolean flag){
		Editor editor = share.edit();
		editor.putBoolean("ifshowcontent", flag);
		return editor.commit();
	}
	
	public boolean getIfVoice(){
		return share.getBoolean("ifvoice", false);
	}
	
	public boolean setIfVoice(boolean flag){
		Editor editor = share.edit();
		editor.putBoolean("ifvoice", flag);
		return editor.commit();
	}
	
	public boolean getIfVibrate(){
		return share.getBoolean("ifvibrate", false);
	}
	
	public boolean setIfVibrate(boolean flag){
		Editor editor = share.edit();
		editor.putBoolean("ifvibrate", false);
		return editor.commit();
	}
	
	public boolean getIfSilent(){
		return share.getBoolean("ifsilent", false);
	}
	
	public boolean setIfSilent(boolean flag){
		Editor editor = share.edit();
		editor.putBoolean("ifsilent", flag);
		return editor.commit();
	}
	
	public int getStartTime(){
		return share.getInt("starttime", 0);
	}
	
	public int getEndTime(){
		return share.getInt("endtime", 0);
	}
	
	public boolean setStartTime(int num){
		Editor editor = share.edit();
		editor.putInt("starttime", num);
		return editor.commit();
	}
	
	public boolean setEndTime(int num){
		Editor editor = share.edit();
		editor.putInt("endtime", num);
		return editor.commit();
	}
}
